gdkwindow: Call function instead of copying its code
authorBenjamin Otte <otte@redhat.com>
Fri, 28 Feb 2014 02:07:18 +0000 (03:07 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 28 Feb 2014 02:09:23 +0000 (03:09 +0100)
gdk_window_get_origin() is just a variant of
gdk_window_get_root_coords() after all.

gdk/gdkwindow.c

index 1a22cd7b450fe2d1e55d504727dc2ffdf804c902..17c6d09431284e7b1ef3a528295f2f0db675f1ee 100644 (file)
@@ -6135,24 +6135,14 @@ gdk_window_get_origin (GdkWindow *window,
                       gint      *x,
                       gint      *y)
 {
-  GdkWindowImplClass *impl_class;
+  gint dummy_x, dummy_y;
 
   g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
 
-  if (GDK_WINDOW_DESTROYED (window))
-    {
-      if (x)
-       *x = 0;
-      if (y)
-       *y = 0;
-      return 0;
-    }
-
-  impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-  impl_class->get_root_coords (window->impl_window,
-                              window->abs_x,
-                              window->abs_y,
-                              x, y);
+  gdk_window_get_root_coords (window,
+                              0, 0,
+                              x ? x : &dummy_x,
+                              y ? y : &dummy_y);
 
   return TRUE;
 }